import Vue from 'vue'
Vue.config.productionTip = false
import App from './App.vue'
import store from '@/store'
import typeNav from '@/components/TypeNav'
import Carousel from '@/components/Carousel'
import Pagination from  '@/components/Pagination'
import { Button,MessageBox} from 'element-ui';
Vue.component(typeNav.name,typeNav);
Vue.component(Carousel.name,Carousel);
Vue.component(Pagination.name,Pagination)
Vue.component(Button.name,Button)
//ElementUI注册组件的时候，还有一种写法，挂在原型上
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

import router from '@/router'
//引入MockServer.js----mock数据
import "@/mock/mockServe";
//引入swiper样式
import "swiper/css/swiper.css";
//引入接口
import * as API from '@/api';
//引入插件
import VueLazyload from 'vue-lazyload';
//注册插件
Vue.use(VueLazyload)
//引入表单校验插件
import "@/plugins/validate";
new Vue({
  render: h => h(App),
  router,
  store,
  beforeCreate(){
    Vue.prototype.$bus=this;
    Vue.prototype.$API=API;
  }
}).$mount('#app')
